package test.serverframe.armc.server.manager.service.impl;

import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import test.serverframe.armc.server.manager.dao.mapper.TaskEnterInterfaceMapper;
import test.serverframe.armc.server.manager.domain.TaskEnterInterface;
import test.serverframe.armc.server.manager.service.TaskEnterInterfaceService;

import java.lang.reflect.InvocationTargetException;
import java.util.List;


/**
 * @author Uaena
 */
@Service
public class TaskEnterInterfaceServiceImpl implements TaskEnterInterfaceService {

    @Autowired
    private TaskEnterInterfaceMapper taskEnterInterfaceMapper;

    @Override
    public int insert(TaskEnterInterface record) {
        return 0;
    }

    @Override
    public int insertSelective(TaskEnterInterface record) {
        return 0;
    }

    @Override
    public TaskEnterInterface selectByPrimaryKey(String id) {
        return taskEnterInterfaceMapper.selectByPrimaryKey(id);
    }

    @Override
    public int updateByPrimaryKey(TaskEnterInterface record) {
        return 0;
    }

    @Override
    public int updateByPrimaryKeySelective(TaskEnterInterface record) {
        return 0;
    }

    @Override
    public int deleteByPrimaryKey(String id) {
        return 0;
    }

    @Override
    public PageInfo<TaskEnterInterface> pageFind(int pageNum, int pageSize, Object parameter) throws IllegalAccessException, InvocationTargetException, NoSuchMethodException {
        return null;
    }

    @Override
    public TaskEnterInterface findByTaskId(String taskId) {
        return taskEnterInterfaceMapper.selectByTaskId(taskId);
    }

    @Override
    public List<TaskEnterInterface> findByTaskIds(String taskId) {
        return taskEnterInterfaceMapper.selectByTaskIds(taskId);
    }

    @Override
    public String[] findNodeIds(String taskId) {
        List<TaskEnterInterface> taskEnterInterfaces = taskEnterInterfaceMapper.selectByTaskIds(taskId);
        String[] nodeids = new String[taskEnterInterfaces.size()];
        for (int i = 0; i < taskEnterInterfaces.size(); i++) {
            TaskEnterInterface taskEnterInterface = taskEnterInterfaces.get(i);
            String nodeid = taskEnterInterface.getNodeId();
            nodeids[i] = nodeid;
        }
        return nodeids;
    }


}
